﻿using System;
using System.Collections.Generic;
using System.Text;
using MVCFoto.IDAL;

namespace MVCFoto.BLL
{
    public class Friend
    {
        private static readonly IFriend dal = MVCFoto.DALFactory.Factory.Create<IFriend>("Friend");
         public bool AddFriend(int userId, int friendId)
         {
             return dal.AddFriend(userId, friendId);
        }
         public bool DeleteFriend(int userId, int friendId)
         {
             return dal.DeleteFriend(userId, friendId);
         }
        /// <summary>
        /// 指定用户是否为当前用户的好友
        /// </summary>
        /// <param name="friendId"></param>
        /// <returns></returns>
         public static bool IsMyFriend(int friendId)
         {
             return dal.IsUserFriend(User.MyID, friendId);
         }
        /// <summary>
        /// 当前用户是否为指定用户的好友
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
         public static bool IsUserFriend(int userId)
         {
             return dal.IsUserFriend(userId,User.MyID);
         }
    }
}
